<%@ page import="java.util.HashMap,common.CommonUtil,java.util.*,common.*" contentType="text/html; charset=utf-8" %>
<%@ taglib uri="/WEB-INF/commontags.tld" prefix="common" %><%--페이징처리tag--%>
<%
UserSession userSession = (UserSession)session.getAttribute("user"); 

String login_id = null;
String user_id = null;
String level = null;
String admin_ent_id = null;

if(userSession!= null){
	login_id = userSession.getLogin_id();
	user_id = userSession.getUser_id();
	level = userSession.getAdmin_level();
	admin_ent_id = userSession.getEnt_id();
}


String line_number	= CommonUtil.nvl(request.getParameter("line_number"),"10");
//페이징 처리 Start
//페이지 표시정보 받기 혹은 검색입력창
String curr_page = CommonUtil.nvl(request.getParameter("curr_page"),"1");

String one_group = CommonUtil.nvl(request.getParameter("one_group"),"10");
String total_count = CommonUtil.nvl(request.getParameter("total_count"),"0");
//페이징 처리 End

String ent_id	= CommonUtil.nvl(request.getParameter("ent_id"),""); 
String gubun	= CommonUtil.nvl(request.getParameter("gubun"),""); 
String start_date	= CommonUtil.nvl(request.getParameter("start_date"),""); 
String end_date	= CommonUtil.nvl(request.getParameter("end_date"),"");


HashMap listMap=(HashMap)request.getAttribute("list_map");

HashMap map  = null;
ArrayList list=null;


String total_cnt	= "0";
String level1	= "0";
String level2	= "0";
String level3	= "0";
String level4	= "0";
String level5	= "0";
String level6	= "0";
String level7	= "0";
String level8	= "0";

String ent_nm="";
String r_num="";

if (listMap!=null){
	list=(ArrayList)listMap.get("mainContent");
}



if(list != null){
	if(list.size() > 0){
		total_count = (String)((HashMap)list.get(0)).get("total_row");
		System.out.println("total_count ========> " + total_count);
	}
}

if(list.size() == 0){
	total_count = "0";
}

%>
<jsp:include page="/jsp/common/header.jsp"></jsp:include>
<style>
body{background-color:#fff;background:#ffffff}
</style>
<script language='javascript' src="/js/ajaxutil.js"></script>
<script language='javascript' src="/js/calendar.js"></script>
<script>


//페이지 번호를 눌렸을때.
function go_page(page){
	var frm = document.mainform;
	frm.cmd.value='ts_stats_3';
	frm.curr_page.value = page ;			
	frm.total_count.value = "<%=total_count%>";
	frm.action = "/speaking.pb";
	frm.target="_self";
	frm.submit();
}
</script>


<form name="mainform"  method="post" action = "/speaking.pb" >
<input type="hidden" name="start_date" value="<%=start_date %>">
<input type="hidden" name="end_date" value="<%=end_date %>">
<input type="hidden" name="ent_id" value="<%=ent_id %>">
<input type="hidden" name="gubun" value="<%=gubun %>">


	<div id="bodyContainer">
        <div id="contents">
          <div class="statistics_opic" style="height:410px;">
          	<dl title="기업별 성적 통계">
              <dt>기업별 성적  통계</dt>
            </dl>
            <table class="graphTb">
              <tr>
                <th>기업명</th>
                <th>Level1</th>
                <th>Level2</th>
                <th>Level3</th>
                <th>Level4</th>
                <th>Level5</th>
                <th>Level6</th>
                <th>Level7</th>
                <th>Level8</th>
                
              </tr>
<%               

    if (list!=null && list.size()> 0) {
    	for(int i=0; i<list.size(); i++){
	      map=(HashMap)list.get(i);
	      r_num = CommonUtil.nvl((String)map.get("r_num"));   
	      ent_nm = CommonUtil.nvl((String)map.get("ent_nm"));
	      
	      total_cnt = CommonUtil.nvl((String)map.get("total_cnt"));
	      level1 = CommonUtil.nvl((String)map.get("level1"));
	      
	      level2 = CommonUtil.nvl((String)map.get("level2"));
	      level3 = CommonUtil.nvl((String)map.get("level3"));
	      level4 = CommonUtil.nvl((String)map.get("level4"));
	      level5 = CommonUtil.nvl((String)map.get("level5"));
	      level6 = CommonUtil.nvl((String)map.get("level6"));
	      level7 = CommonUtil.nvl((String)map.get("level7"));
	      level8 = CommonUtil.nvl((String)map.get("level8"));
%>	      
              <tr>
                <td class="frq"><%=ent_nm %></td>
                <td class="frq"><%=level1 %></td>
                <td class="frq"><%=level2 %></td>
                <td class="frq"><%=level3 %></td>
                <td class="frq"><%=level4 %></td>
                <td class="frq"><%=level5 %></td>
                <td class="frq"><%=level6 %></td>
                
                <td class="frq"><%=level7 %></td>
                <td class="frq"><%=level8 %></td>
              </tr>
<%
	
    	}
    }else{

%> 
    		<tr>
    	    	<td colspan=11 align=center>데이터가 없습니다.</td>
    	    </tr>
<%
   }
%>
             </table>
            
            <!-- 페이징 -->
            <div class="paging"><common:pagelistnew currPage="<%=curr_page%>" total="<%=total_count%>" onePage="<%=line_number%>" oneGroup="<%=one_group%>"/></div>
            <!-- //페이징 -->
          </div>  
        </div>
      </div>


<input type="hidden" name="cmd" value="">
<input type="hidden" name="member_id" value="">
<input type="hidden" name="user_id" value="<%=user_id %>">
<input type="hidden" name="member_test_code" value="">
<input type="hidden" name="line_number" value="<%=line_number%>">
<input type="hidden" name="curr_page" value="<%=curr_page%>">
<input type="hidden" name="total_count" value="<%=total_count%>">
</form>

<iframe name='hidden_frm'  width='0' height='0' SCROLLING='AUTO' frameborder='0'></iframe>


<jsp:include page="/jsp/common/bottom.jsp"></jsp:include>
